<?php
$company = $data['company'];
//dump($_ENV);
//dump($data);
function safePhone($phone) {
    return substr($phone, 0, 3) . '***' . substr($phone, 7, 4);
}
function safeEmail($email) {
    return substr($email, 0, 3) . '***' . strstr($email, '@');
}
?>
<!DOCTYPE html>
<html lang="zh-CN" style="font-size: 50px">
<head>
    <include file="Common/meta" />
    <title>企业详情 - {$_ENV['site'][0]['title']}</title>
    <include file="Common/link" />
    <style>
        body {
            padding-top: 0;
        }
        .mycarousel { /* TODO eui 还需要完善 */
            height: 200px;
        }
        .mycarousel .item {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body class="bg-gray">
<div class="layout-body">
    <div class="container">
        <section class="box user-box">
            <header class="box-header com-detail-bg">
                <header class="layout-header header-inline">
                    <h1 class="title">企业主页</h1>
                    <a class="header-back" href="#"><i class="icon icon-left"></i></a>
                </header>
                <div class="avatar-box">
                    <img class="user-avatar" src="{$company['logo']}">
                    <if condition="$company['is_verify'] eq '1'">
                        <img class="user-valid" src="/public/asset/img/valid.png">
                    </if>
                </div>

            </header>
            <div class="box-body">
                <div class="parise">
                    <if condition="$data['is_parise'] eq 0">
                        <a id="parise" class="parise-icon" href="#" disabled><i class="icon icon-praise"></i></a>
                        <span id="parise-num" class="parise-num">{$company['parise']}</span>
                        <else />
                        <a id="parise" class="parise-icon disabled" href="#"><i class="icon icon-praise"></i></a>
                        <span id="parise-num" class="parise-num">{$company['parise']}</span>
                    </if>
                </div>

                <div class="name">{$company['name']}</div>

                <div class="info"><i class="icon icon-position"></i> {$company['area']}</div>
                <div class="info"><i class="icon icon-tag"></i> {$company['industry']}</div>
                <if condition="$data['is_like'] eq 0">
                    <div class="like-icon">
                        <a id="like" href="#">
                            <img class="like-img" src="/public/asset/img/icon-like.jpg">
                            <div class="like-text">LIKE</div>
                        </a>
                    </div>
                    <else />
                    <div class="like-icon">
                        <a id="like" class="disabled" href="#">
                            <img class="like-img" src="/public/asset/img/icon-like.jpg">
                            <div class="like-text">LIKE</div>
                        </a>
                    </div>
                </if>
            </div>
        </section>
        <section class="box box-detail">
            <header class="box-header">
                <h3 class="box-title">公司介绍</h3>
            </header>
            <div class="box-body">
                <empty name="company['desc']">
                    <p>暂无介绍</p>
                </empty>
                <article id="com-desc" class="article">{$company['desc']}</article>
                <a id="more-desc" class="more-text" href="#"><i class="icon icon-down"></i> 展开</a>
            </div>
        </section>
        <section class="box box-detail">
            <header class="box-header">
                <h3 class="box-title">联系方式</h3>
            </header>
            <div class="box-body">
                <div class="info"><i class="icon icon-phone"></i> {$company['phone']}</div>
                <div class="info"><i class="icon icon-email"></i> {$company['email']}</div>
                <div class="info"><i class="icon icon-position"></i> {$company['address']}</div>
            </div>
        </section>
        <section class="box box-detail">
            <header class="box-header">
                <h3 class="box-title">产品介绍</h3>
            </header>
            <div class="box-body no-padding">
                <include file="Common/com_production" />
            </div>
        </section>
        <section class="box box-detail">
            <header class="box-header">
                <h3 class="box-title">团队介绍</h3>
            </header>
            <div class="box-body">
                <if condition="count($data['member']) eq 0">
                    <h3 class="title">暂无团队介绍</h3>
                </if>

                <div class="team-list">
                    <foreach name="data['member']" item="member">
                        <div class="list-item">
                            <empty name="member['member_url']">
                                <img class="team-img" src="{$member['member_photo']}">
                                <div><span class="team-name">{$member['member_name']}</span></div>
                            <else />
                                <a href="{$member['member_url']}" target="_blank">
                                    <img class="team-img" src="{$member['member_photo']}">
                                </a>
                                <a href="{$member['member_url']}" target="_blank">
                                    <div><span class="team-name">{$member['member_name']}</span></div>
                                </a>
                            </empty>
                        </div>
                    </foreach>
                </div>
            </div>
        </section>
        <section class="box box-detail">
            <header class="box-header">
                <h3 class="box-title">校园招聘</h3>
            </header>
            <div class="box-body no-padding">
                <if condition="count($data['news']) eq 0">
                    <div class="empty">该公司还未发布校园招聘</div>
                </if>
                <ul class="list com-job-list">
                    <foreach name="data['news']" item="news">
                        <li class="list-item">
                            <a class="title" href="/news/detail?id={$news['id']}">{$news['title']}
                                <span class="time">{$news['create_time']|strtotime|date='Y-m-d',###}</span>
                            </a>
                        </li>
                    </foreach>
                </ul>
            </div>
        </section>
    </div>
</div>

<!-- 喜欢弹出框 -->
<div id="like-wrap" class="like-wrap">
    <section id="like-dialog" class="box box-like">
    <header>LIKE</header>
    <div class="box-body">
        <textarea id="like-text" placeholder="你想对这家公司说什么？" rows="4"></textarea>
        <div id="quick-box">
            <p>示例:</p>
            <ul id="quick-list" class="quick-list clear">
                <li><a href="#">我很喜欢你们公司，希望能进贵公司实习</a></li>
                <li><a href="#">我能力不错，希望能进公司锻炼</a></li>
                <li><a href="#">公司技术氛围不错，很喜欢你们公司</a></li>
            </ul>
        </div>

        <input class="login-btn cancel" type="button" value="取消">
        <input class="login-btn submit" id="like-btn" type="button" value="确定">

    </div><!-- ./box-body -->
</section>
</div><!-- ./like-wrap -->

<script>
    var page = {
        userType: '{$_ENV['user']['type']}',
        position: '{$company['map']}',
        companyId: '{$company['id']}'
    };
</script>
<include file="Common/script" />
<script src="__PUBLIC__/asset/js/com_detail.js"></script>
</body>
</html>

